import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import Unocss from "unocss/vite";

export default defineConfig({
  plugins: [vue(), Unocss()],
  resolve: {
    // src 别名配置
    alias: {
      "@": resolve(__dirname, "src")
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@use "@/styles/var.scss";`
      }
    }
  },
  server: {
    host: "0.0.0.0",
    port: 8848,
    open: true,
    cors: true,
    proxy: {
      "/admin": {
        target: "http://127.0.0.1:8091",
        changeOrigin: true
      }
    }
  }
});
